﻿using JinianNet.JNTemplate;

namespace RuoVea.CodeGen.Util;

/// <summary>
/// 
/// </summary>
public class JNTemplateEx
{
    /// <summary>
    /// 
    /// </summary>
    /// <param name="content"></param>
    /// <returns></returns>
    public static ITemplate CreateTemplate(string content){
        // 加载模板
        var template = Engine.CreateTemplate(content);
        //template.Set("Now", DateTime.Now);
        //template.SetStaticType("DateTime", typeof(DateTime));
        template.SetStaticType(typeof(DateTime));
        template.SetStaticType("string", typeof(string));

        return template;
    }
}
